package com.bwei.topnews.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.bwei.topnews.R;
import com.bwei.topnews.base.MyBaseAdapter;

import java.util.List;

/**
 * Created by qwe on 2016/11/8.
 */
public class SlidingAdapter extends MyBaseAdapter<Integer> {

    int[] title = new int[]{R.string.leftdrawer_friend_dynamic, R.string.leftdrawer_my_topic,
            R.string.leftdrawer_collect, R.string.leftdrawer_actor, R.string.leftdrawer_shop,
            R.string.leftdrawer_feedback, R.string.leftdrawer_mouth};

    public SlidingAdapter(List list, Context context) {
        super(list, context);
    }

    @Override
    protected View initGetView(int position, View convertView, ViewGroup parent) {

        convertView = View.inflate(context, R.layout.slidingmenu_left, null);
        ImageView imageView = (ImageView) convertView.findViewById(R.id.iv);
        TextView tvTitle = (TextView) convertView.findViewById(R.id.tvTitle);
        imageView.setImageResource(list.get(position));
        tvTitle.setText(title[position]);

        return convertView;
    }
}
